﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using DesignerHelper.Commands;
using DesignerHelper.EventHandlers;
using SpreadsheetGear;
using SpreadsheetGear.Windows.Forms;

namespace DesignerHelper.Main
{

    public interface IBookForm 
    {
        Form GetForm();
        WorkbookView WorkbookView { get; }
        IWorkbook ActiveBook { get; }
        IWorksheet ActiveWorkSheet { get; }
        bool HasPageBreaks { get; }
        IMainWindow ParentForm { get; }
        IBookEditor Editor { get; }
        void FileSaveAs();
        void SaveFile();
        void ShowLocateRangeDialog();
        void ShowDefineNameDialog();
    }

    public interface IMainWindow
    {

        IBookForm ActiveBookForm { get; }
        WorkbookView ActiveView { get; }
        IFileOperator FileOperator { get; }
        Form GetForm();
    }

    public interface IFileOperator
    {
        event EventHandler<BookSetEventArgs> BookSetModified;

        event CellBeginEditEventHandler CellBeginEditInternal;

        event CellCancelEditEventHandler CellCancelEditInternal;

        event CellEndEditEventHandler CellEndEditInternal;

        event DisableUIEventHandler DisableUI;

        event EnableUIEventHandler EnableUI;

        event RangeSelectionChangedEventHandler RangeSelectionChangedInternal;

        IWorkbookSet MainBookSet { get; }
        IList<IBookForm> AllFormsList { get; }
        List<WorkbookView> ViewList { get; }

        void OpenFiles();
        void OpenWorkbooks();
        void OpenFile(string fileLocation);
        void OpenFile(IWorkbook workbook);
        void NewFile();
        void Close(IBookForm form);
        void Close(IWorkbook workbook);

    }



}